﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace SampleImageGenerator.Core.Events
{
	internal class ImageGeneratedEventArgs : EventArgs
	{
		private Image m_image;

		/// <summary>
		/// Initialises a new instance of the ImageGeneratedEventArgs class 
		/// with the specified description and image. 
		/// </summary>
		/// <param name="id">An identifier for this image. </param>
		/// <param name="description">A description of the image. </param>
		/// <param name="image">The image. </param>
		public ImageGeneratedEventArgs(String id, String description, Image image)
		{
			Id = id;
			Description = description;
			m_image = image;
		}

		/// <summary>
		/// Gets a description of the image. 
		/// </summary>
		public String Description { get; private set; }

		/// <summary>
		/// An identifier for this image. 
		/// </summary>
		public String Id { get; private set; }

		/// <summary>
		/// Returns a copy of the image. The caller is responsible for 
		/// disposing of this image once it is no longer required. 
		/// </summary>
		/// <returns>A copy of the image. </returns>
		public Image GetImage()
		{
			Image copy = new Bitmap(m_image);
			return copy;
		}
	}
}
